package com.link2room.bumblebee.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by LN on 2017/3/7.
 */
@Entity
@DynamicInsert
@Table(name = "code_base")
public class CodeBaseEntity extends BaseEntity{
    public enum CodeBaseEntity_{
        code
    }
    private String code;
    private String parentCode;
    private String name;
    private String descript;
    private String codeType;
    private Integer maxLen;
    private String codeCategory;
    private String isSys;
    private String isGroup;

    @Basic
    @Column(name = "code")
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Basic
    @Column(name = "parent_code")
    public String getParentCode() {
        return parentCode;
    }

    public void setParentCode(String parentCode) {
        this.parentCode = parentCode;
    }

    @Basic
    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "descript")
    public String getDescript() {
        return descript;
    }

    public void setDescript(String descript) {
        this.descript = descript;
    }

    @Basic
    @Column(name = "code_type")
    public String getCodeType() {
        return codeType;
    }

    public void setCodeType(String codeType) {
        this.codeType = codeType;
    }

    @Basic
    @Column(name = "max_len")
    public Integer getMaxLen() {
        return maxLen;
    }

    public void setMaxLen(Integer maxLen) {
        this.maxLen = maxLen;
    }

    @Basic
    @Column(name = "code_category")
    public String getCodeCategory() {
        return codeCategory;
    }

    public void setCodeCategory(String codeCategory) {
        this.codeCategory = codeCategory;
    }

    @Basic
    @Column(name = "is_sys")
    public String getIsSys() {
        return isSys;
    }

    public void setIsSys(String isSys) {
        this.isSys = isSys;
    }

    @Basic
    @Column(name = "is_group")
    public String getIsGroup() {
        return isGroup;
    }

    public void setIsGroup(String isGroup) {
        this.isGroup = isGroup;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        CodeBaseEntity that = (CodeBaseEntity) o;

        if (maxLen != null ? !maxLen.equals(that.maxLen) : that.maxLen != null) return false;
        if (code != null ? !code.equals(that.code) : that.code != null) return false;
        if (parentCode != null ? !parentCode.equals(that.parentCode) : that.parentCode != null) return false;
        if (name != null ? !name.equals(that.name) : that.name != null) return false;
        if (descript != null ? !descript.equals(that.descript) : that.descript != null) return false;
        if (codeType != null ? !codeType.equals(that.codeType) : that.codeType != null) return false;
        if (codeCategory != null ? !codeCategory.equals(that.codeCategory) : that.codeCategory != null) return false;
        if (isSys != null ? !isSys.equals(that.isSys) : that.isSys != null) return false;
        if (isGroup != null ? !isGroup.equals(that.isGroup) : that.isGroup != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = code != null ? code.hashCode() : 0;
        result = 31 * result + (parentCode != null ? parentCode.hashCode() : 0);
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (descript != null ? descript.hashCode() : 0);
        result = 31 * result + (codeType != null ? codeType.hashCode() : 0);
        result = 31 * result + (maxLen != null ? maxLen.hashCode() : 0);
        result = 31 * result + (codeCategory != null ? codeCategory.hashCode() : 0);
        result = 31 * result + (isSys != null ? isSys.hashCode() : 0);
        result = 31 * result + (isGroup != null ? isGroup.hashCode() : 0);
        return result;
    }
}
